package com.yidu.sanrenxing.crudall.dao;

import com.yidu.sanrenxing.crudall.domain.Shopping;

import java.util.List;
import java.util.Map;

public interface ShoppingMapper {
    List<Shopping> selectByUserId(int userid);

    List<Shopping> selectAll();

    int deleteByPrimaryKey(int shoppingid);

    int insert(Shopping record);

    int insertSelective(Shopping record);

    Shopping selectByPrimaryKey(int shoppingid);

    int updateByPrimaryKeySelective(Shopping record);

    int updateByPrimaryKey(Shopping record);

    /**
     * 根据用户id和comId删除购物车中信息
     * @param map
     * @return
     */
    Integer deleteShoppingCarMsgByComIdAndUserId(Map<String,Object> map);

    /**
     * 查询指定用户和商品编号是否已经存在
     * @param map
     * @return
     */
    Integer queryUserIdAndComIdIfExit(Map<String,Object> map);

    /***
     * 增加购物车数量
     * @param map
     * @return
     */
    Integer updateShoppingCarById(Map<String,Object> map);
}